Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(feedBrain): add request pending message #1135 #1136

Merged
merged 3 commits into from
Sep 8, 2023
Merged

Conversation

mamadoudicko
Copy link
Contributor

@mamadoudicko mamadoudicko commented Sep 7, 2023

Screen.Recording.2023-09-07.at.17.01.28.mov

@vercel
Copy link

vercel bot commented Sep 7, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
docs ✅ Ready (Inspect) Visit Preview 💬 Add feedback Sep 7, 2023 3:56pm
quivrapp ✅ Ready (Inspect) Visit Preview 💬 Add feedback Sep 7, 2023 3:56pm

@mamadoudicko mamadoudicko temporarily deployed to preview September 7, 2023 14:49 — with GitHub Actions Inactive
@mamadoudicko
Copy link
Contributor Author

#1129

@github-actions
Copy link
Contributor

github-actions bot commented Sep 7, 2023

Risk Level 2 - /home/runner/work/quivr/quivr/frontend/app/chat/[chatId]/tests/page.test.tsx

The code changes seem to be mostly about importing and mocking modules for testing. There doesn't seem to be any high-risk changes. However, it's important to ensure that the mocks accurately represent the real modules to avoid false positives or negatives in the tests. Also, the getHistory function in the useChatApi mock returns an empty array. If the tests depend on the chat history, this could lead to incorrect test results.


Risk Level 3 - /home/runner/work/quivr/quivr/frontend/app/chat/[chatId]/components/ActionsBar/ActionsBar.tsx

  1. The useEffect hook is used to update the hasPendingRequests state. However, there's no error handling for the getHistory function. If it fails, the error will be unhandled which could lead to unexpected behavior. Consider adding a try-catch block.
useEffect(() => {
  const updateNotificationsStatus = async () => {
    const chatId = params?.chatId as string | undefined;
    if (chatId !== undefined) {
      try {
        const history = await getHistory(chatId);
        setHasPendingRequests(checkIfHasPendingRequest(history));
      } catch (error) {
        console.error(error);
        // handle error
      }
    }
  };
  void updateNotificationsStatus();
}, [getHistory, params?.chatId]);
  1. The params?.chatId is cast to string | undefined but it's not clear if params can be undefined. If params can be undefined, params?.chatId would be undefined and the cast would be unnecessary. If params can't be undefined, the optional chaining operator (?.) would be unnecessary.

📑🔍🚧


Powered by Code Review GPT

@gozineb gozineb merged commit 7e1e13f into main Sep 8, 2023
7 checks passed
StanGirard pushed a commit that referenced this pull request Sep 12, 2023
* feat(feed brain): add pending message

* feat: add 'filesUploading' translation

* feat(chatPage): update tests
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants